/*
* Copyright 2005-2008 Pulse Technologies. Tutti i diritti riservati.
*/
package org.obsidianrad.server.services.user;

import java.io.Serializable;
import java.util.HashMap;

import org.springframework.security.GrantedAuthority;
import org.springframework.security.userdetails.User;

/**
 * 
 * @author Eligio Colutta
 * @version $Rev: 4 $
 * @lastautorcommit $Author: eliosh $
 * @lastdatecommit $Date: 2009-10-31 12:37:28 +0100(sab, 31 ott 2009) $
 */
public class ObsidianUserDetails extends User{

	private static final long serialVersionUID = 6388471116718575793L;

	private boolean canSuperAdmin;
	private HashMap<String, Serializable> preferences;
	
	public ObsidianUserDetails(
			String username, 
			String password, 
			boolean enabled, 
			boolean accountNonExpired, 
			boolean credentialsNonExpired, 
			boolean accountNonLocked,
			GrantedAuthority[] authorities) throws IllegalArgumentException {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
	}

	/**
	 * @return the canSuperAdmin
	 */
	public boolean isCanSuperAdmin() {
		return canSuperAdmin;
	}

	/**
	 * @param canSuperAdmin the canSuperAdmin to set
	 */
	public void setCanSuperAdmin(boolean canSuperAdmin) {
		this.canSuperAdmin = canSuperAdmin;
	}

	@Override
	public void setAuthorities(GrantedAuthority[] authorities) {
		super.setAuthorities(authorities);
	}

	/**
	 * @return the preferences
	 */
	public HashMap<String, Serializable> getPreferences() {
		return preferences;
	}

	/**
	 * @param preferences the preferences to set
	 */
	public void setPreferences(HashMap<String, Serializable> preferences) {
		this.preferences = preferences;
	}

	
}
